<?php

namespace App\Models;

class Region extends BaseModel
{
    protected $table = "region";

    public function children() {
        return $this->hasMany(self::class, 'parent_id', 'id');
    }

    public function parent()
    {
        return $this->belongsTo(self::class, 'parent_id');
    }

    public function regions()
    {
        return $this->children()->with('regions');
    }
}
